package com.party.admin.task;

import com.party.admin.biz.merchantAnalyze.MemberMerchantDetailBizService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 主页视图数据更新
 * Created by hqh
 *
 * @date 2018/10/09 0030
 * @time 10:25
 */

@Component(value = "QuartzMainViewAnalyze")
public class QuartzMainViewAnalyze {

    @Autowired
    private MemberMerchantDetailBizService memberMerchantDetailBizService;

    protected static Logger logger = LoggerFactory.getLogger(QuartzMainViewAnalyze.class);

    /**
     * 主页视图数据分析数据更新
     */
    public void refresh(){
        logger.info("主页视图数据更新定时任务启动");
        try {

            long stime = System.currentTimeMillis();

            memberMerchantDetailBizService.updateMainViewAnalyze();

            long dtime = stime-System.currentTimeMillis();
            logger.info("主页视图数据更新定时任务结束,用时:"+dtime);
        } catch (Exception e) {
            logger.error("主页视图数据更新定时任务启动异常", e);
        }
    }
}
